<template>
<div class="banner-wrapper">
  <!-- 景点详情页面的轮播图开始 -->
  <div class="detail-banner" @click="showBigPicture">
    <div class="icon-wrapper" @click.stop="returnHome">
      <span class="iconfont">&#xe61e;</span>
    </div>
    <img :src="info.bannerImg" alt="" class="img">
    <div class="img-des-wrapper">
      <div class="site-name">{{info.sightName}}</div>
      <div class="img-total">
        <span class="iconfont icon-img">&#xe616;</span>
        <span class="number">39</span>
      </div>
    </div>
  </div>
  <!-- 景点详情页面的轮播图结束 -->
  <!-- 景点大图轮播图开始 -->
  <fade-animation>
    <div class="big-picture"
    v-if="ifShowBigPic"
    @click="hide">
      <slider
        class="big-picture-slider"
        paginationType="fraction">
        <swiper-slide
          v-for="(item,index) of info.gallaryImgs"
          :key="index">
          <img :src="item" alt="" class="banner-big-pic">
        </swiper-slide>
      </slider>
    </div>
  </fade-animation>
  <!-- 景点大图轮播图结束 -->
</div>
</template>
<script>
import slider from '@/base/slider'
import fadeAnimation from '@/base/fadeAnimation'
export default {
  name: 'detailBanner',
  data () {
    return {
      ifShowBigPic: false
    }
  },
  props: {
    info: Object
  },
  components: {
    slider,
    fadeAnimation
  },
  methods: {
    showBigPicture () { // 显示大图
      this.ifShowBigPic = true
    },
    hide () { // 隐藏图片
      this.ifShowBigPic = false
    },
    returnHome () { // 回到首页
      this.$router.push({
        name: 'home'
      })
    }
  }
}
</script>
<style lang="stylus" scoped>
// 放大图的轮播图页码的样式
.big-picture-slider>>>.swiper-pagination-fraction
  color #fff
  font-size 20px
.detail-banner
  width 100%
  height 0
  padding-bottom 55%
  position relative
  .icon-wrapper
    position absolute
    left 15px
    top 20px
    z-index 10
    width 40px
    height 40px
    border-radius 50%
    background rgba(0,0,0,0.75)
    display flex
    justify-content center
    align-items center
    .iconfont
      color #eee
  .img
    width 100%
  .img-des-wrapper
    width 100%
    position absolute
    padding 0 10px
    bottom 10px
    display flex
    justify-content space-between
    color #eee
    .site-name
      font-size 16px
    .img-total
      display flex
      align-items center
      .icon-img
        padding-right 8px
.big-picture
  position absolute
  top 0
  bottom 0
  left 0
  right 0
  background black
  z-index 10
  display flex
  align-items center
  .banner-big-pic
    width 100%
    height 100%
</style>
